
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>设备台账详情</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all">
  <style>
    .layui-form-item{
        width: 33.33% !important;
        float: left;
        margin-right: 0px;
        clear: none;
    }
    .layui-input-block{
        margin-left: 150px;
    }
    .layui-input-block .layui-icon-date{
        position: absolute;
        top:0;
        left: 10px;
    }
    .layui-input-block .layui-icon-date+input{
        padding-left: 30px;
    }
    .layui-step-content-item{
        background-color: transparent;
    }
    .layui-form-label{
        width: 120px;
    }

</style>
</head>
<body>
    <div class="layui-fluid">
        <div class="layui-form" action="" lay-filter="layuiadmin-form-accountBind">
            <div class="layui-form-item">
                <label class="layui-form-label">选择设备</label>
                <div class="layui-input-block">
                    <select name="stationName" id="bindEquipent" lay-filter='bindEquipent'>
                    </select>
                </div>
            </div> 
            <button class="layui-btn layuiadmin-btn-list cancelBtn" style="margin-left: 20px;">取消关联</button>
            <div class="layui-form-item layui-hide">
                <input type="button" lay-submit lay-filter="layuiadmin-app-form-submit" id="layuiadmin-app-form-submit" value="确认添加">
                <input type="button" lay-submit lay-filter="layuiadmin-app-form-edit" id="layuiadmin-app-form-edit" value="确认编辑">
              </div>
        </div>
        
    </div>
<script src='../../layuiadmin/modules/jTools.js'></script>
<script src="../../layuiadmin/layui/layui.js"></script>  
<script>
    function initData(data){
        layui.config({
            base: '../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
            , my_send: '../myModules/my_send'
        }).use(['index', 'equipment', 'form','laydate','my_send'], function(){
            var $ = layui.$
            ,form = layui.form
            ,table = layui.table
            ,laydate = layui.laydate
            ,my_send = layui.my_send 
            ,formfMcId = jTools.getQuery('fMcId')
            ,http_proxy = layui.http_proxy;
            $.ajax({
                type : "get",
                async : false, //异步执行
                url : 'http://127.0.0.1:10090/account/getAllHostList?productId='+data.productId,
                dataType : "json", //返回数据形式为json
                success : function(data) {
                    $("#bindEquipent").append(new Option("请选择",""));
                    $.each(data.rows,function(index,item){
                        $('#bindEquipent').append(new Option(item.name,item.host_id));
                    })
                    form.render('select');
                },
                error : function(errorMsg) {
                    alert("请求数据失败");
                }
            });
            console.log();
            $('.cancelBtn').click(function(){
               if($("#bindEquipent").val()===''){
                  layer.msg('该设备还未绑定',{icon:5});
               }else{
                   
               }
            })
        })
    }
</script>
</body>
</html>
